package com.dorm.service;

import com.dorm.entity.DisciplinaryRecord;
import com.dorm.mapper.DisciplinaryRecordMapper;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class DisciplinaryRecordService {
    private final DisciplinaryRecordMapper disciplinaryRecordMapper;

    public DisciplinaryRecordService(DisciplinaryRecordMapper disciplinaryRecordMapper) {
        this.disciplinaryRecordMapper = disciplinaryRecordMapper;
    }

    public List<DisciplinaryRecord> getRecordsByStudent(Long studentId) {
        return disciplinaryRecordMapper.findByStudentId(studentId);
    }

    public DisciplinaryRecord createRecord(DisciplinaryRecord record) {
        disciplinaryRecordMapper.insert(record);
        return record;
    }

    public void deleteRecord(Long id) {
        disciplinaryRecordMapper.deleteById(id);
    }
} 